﻿/*
 * Author: .net follower (http://dotnetfollower.com)
 * Url: http://bdcrequestlib.codeplex.com/
 * Title: SharePoint Bdc Requests
 * Copyright: � 2012 .net follower 
 * Usage: software is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 */

using Microsoft.SharePoint;

namespace SharePointBdcRequests
{
    public class BdcRequestParams
    {
        public string LobSystemInstanceName;
        public string EntityNamespace;
        public string EntityName;
        public SPSite SpSite;

        public BdcRequestParams() {}
        public BdcRequestParams(SPBusinessDataField businessDataField)
        {
            if(businessDataField != null)
            {
                LobSystemInstanceName = businessDataField.SystemInstanceName;
                EntityName            = businessDataField.EntityName;
                EntityNamespace       = businessDataField.EntityNamespace;
                SpSite                = businessDataField.ParentList.ParentWeb.Site;
            }
        }
    }

    public class BdcRequestByIdParams : BdcRequestParams
    {
        public string   EntityInstanceEncodedId;
        public object[] EntityInstanceIds;

        public BdcRequestByIdParams() {}
        public BdcRequestByIdParams(SPBusinessDataField businessDataField) : base(businessDataField) {}
    }

    public class BdcRequestByValueParams : BdcRequestParams
    {
        public object ValueToSearch;
        public string FilterName;

        public BdcRequestByValueParams() {}
        public BdcRequestByValueParams(SPBusinessDataField businessDataField) : base(businessDataField) { }
    }
}
